package com.sl.biz.modular.datasource.service;

import com.sl.biz.modular.datasource.controller.request.*;
import com.sl.biz.modular.datasource.dao.domain.dto.ProcessDataSourceDTO;
import com.sl.biz.modular.datasource.dao.domain.entity.ProcessDataSourceDO;
import com.sl.core.engine.datasource.domain.dto.SqlQueryResultDTO;
import com.sl.core.engine.datasource.domain.dto.TableColumnDTO;
import com.sl.core.engine.datasource.domain.dto.TableIndexDTO;
import com.sl.core.engine.datasource.domain.dto.TableKeysDTO;

import java.util.List;
import java.util.Map;

public interface ProcessDatasourceBizService {
    List<ProcessDataSourceDTO> list();

    Boolean save(ProcessDataSourceDO addRequest);

    ProcessDataSourceDTO getById(ProcessDataSourceDTO addRequest);

    Boolean removeById(ProcessDataSourceDO removeByIdRequest);

    Boolean setStatusFlag(ProcessDataSourceDO assertUserUse);

    String testConnection(ProcessDataSourceDO assertUserUse);

    List<String> querySchemaList(ProcessDataSourceDTO assertUserUse);

    List<String> queryCatalogList(ProcessDataSourceDTO assertUserUse);

    Boolean supportsCatalogs(ProcessDataSourceDTO assertUserUse);

    Boolean supportsSchemas(ProcessDataSourceDTO assertUserUse);

    List<String> queryTableList(ProcessDataSourceQueryTableListRequest assertUserUse);

    List<TableColumnDTO> queryTableFieldList(ProcessDataSourceQueryTableMetaListRequest assertUserUse);

    String queryTableDdl(ProcessDataSourceQueryTableDdlRequest assertUserUse);

    SqlQueryResultDTO run(ProcessDataSourceRunRequest assertUserUse);

    List<TableIndexDTO> queryTableIndexList(ProcessDataSourceQueryTableMetaListRequest assertUserUse);

    List<TableKeysDTO> queryKeysList(ProcessDataSourceQueryTableMetaListRequest assertUserUse);


    Boolean addUpdateTable(ProcessDataSourceAddUpdateTableRequest assertUserUse);

    Boolean removeTable(ProcessDataSourceAddUpdateTableRequest assertUserUse);

    Boolean addUpdateIndex(ProcessDataSourceAddUpdateIndexRequest assertUserUse);

    String queryCreateTableFieldList(ProcessDataSourceQueryCreateTableMetaListRequest assertUserUse);

    Boolean executeDdl(ProcessDataSourceExecuteDdlRequest assertUserUse);

    String queryUpdateTableFieldList(ProcessDataSourceQueryUpdateTableMetaListRequest assertUserUse);

    Boolean dropIndex(ProcessDataSourceDropIndexRequest assertUserUse);

    Map<String, Object> queryTableFieldModelList(ProcessDataSourceQueryTableMetaListRequest assertUserUse);

    List<ProcessDataSourceDTO> getByIds(List<String> datasourceIds);
}
